package anonymouschat.messages.clientrequests;

import anonymouschat.client.Identity;

/**
 * This req is sent when a user is logging out.
 * 
 * @author bh349
 */
public class UserLogoutRequest extends ClientRequest {

	private static final long serialVersionUID = 668151726077410297L;

	// the current system time used as a timestamp
	private long announceTime = 0;

	public Identity identity;

	byte[] signedRequest;

	/**
	 * Generates a logout request signed by the user logging out
	 * 
	 * @param fullIdent
	 *            the full identity of the user logging out
	 */
	public UserLogoutRequest(Identity fullIdent) {
		super(fullIdent.getUserName());
		this.identity = fullIdent;
	}

	/**
	 * 
	 * @return String representing the user identity
	 */
	@Override
	public String getSrcUserName() {
		return identity.getUserName();
	}

	/**
	 * 
	 * @return the timestamp of the logout announcement
	 */
	public long getAnnounceTime() {
		return this.announceTime;
	}
}
